<span id="load" url="<?=image_url('load.gif');?>"></span>
<div class="row">
	<div class="panel">
		Students/Subject Schedule for  <strong><?=$section_profile->section_name;?></strong>
	</div>
	<div>
		<label class="label">Students</label>
		<hr class="clearfix">
		<table class="table table-bordered table-striped">
			<thead>
				<tr>
					<td>Students Name</td>
				</tr>
			</thead>
			<tbody>
				<?if(!empty($students)):?>
					<?foreach($students as $k => $v):?>
						<tr>
							<td><?=$v->fullname;?></td>
						</tr>
					<?endforeach;?>
				<?else:?>
				<tr>
					<td>No student Enrolled/Assigned on this section.</td>
				</tr>
				<?endif;?>
			</tbody>
		</table>
	</div>
	
	<div>
	<label class="label">Subject Schedule</label>
	<hr class="clearfix">
	<?=$system_message;?>

	<?if(!empty($schedules)):?>
		<table class="table">
			<thead class="tabular-head">
			<tr>
				<th>Subject ID</th>
				<th>Subject</th>
				<th>Teacher</th>
				<th></th>
				<th>Time</th>
				<th>Day</th>
				<th>&nbsp;</th>
			</tr>
			</thead>
			<tbody>
			<?foreach($schedules as $s):?>
				<tr>
					<td><?=$s->subj_uniq_id.'_'.$s->schedule_id.'_'.$section_id;?></td>
					<td><?=$s->subj_desc;?></td>
					<td colspan="2">
						<?=form_dropdown('teacher',$teachers,set_value('teacher',$s->tid),'class="ajax-change" url="'.site_url('output/set_schedule/'.$s->schedule_id.'/'.$section_id).'" data-type="teacher" id="teacher" style="width:85%;display:inline-block;"')?>
						<span class="loading" style="display:inline-block;"></span>
					</td>
					<td>
						<input id="time_from" url="<?=site_url('output/set_schedule/'.$s->schedule_id.'/'.$section_id);?>"type="text" value="<?=$s->time_from;?>" placeholder="from" style="width:70px;display:inline-block;" class="ajax-change" data-type="timefrom" orgval="<?=$s->time_from;?>">
						<input id="time_to" url="<?=site_url('output/set_schedule/'.$s->schedule_id.'/'.$section_id);?>"type="text" value="<?=$s->time_to;?>" placeholder="to" style="width:70px;display:inline-block;" class="ajax-change" data-type="timeto" orgval="<?=$s->time_to;?>">
						<span class="loading" style="display:inline-block;"></span>
					</td>
					<td>
						<input id="day" url="<?=site_url('output/set_schedule/'.$s->schedule_id.'/'.$section_id);?>"type="text"  value="<?=$s->day;?>" style="width:85%;display:inline-block;" class="ajax-change" data-type="days" orgval="<?=$s->day;?>">
						<span class="loading" style="display:inline-block;"></span>
					</td>
					<td><a href="<?=site_url('rss-update-schedule/'.$s->schedule_id.'/'.$section_id);?>" class="btn btn-mini btn-primary">Edit</a></td>
				</tr>
			<?endforeach;?>
			</tbody>
		</table>
		
		<div><a href="<?=site_url('rss-get-curriculum/'.$section_profile->id);?>" class="confirm btn btn-mini" title="Are you sure you want to continue?">Check And Pull Subjects From Curriculum</a></div>
		<?else:?>
			<div class="notice"> No Subjects set on this section <a href="<?=site_url('rss-get-curriculum/'.$section_profile->id);?>" class="confirm btn btn-mini" title="Are you sure you want to continue?">Check And Pull Subjects From Curriculum</a></div>
		<?endif;?>
	</div>
	<a href="<?=site_url('rss-section');?>" class="btn btn-mini btn-primary">Go Back to view all sections</a>
</div>
<script type="text/javascript" src="<?=script_url('custom/schedule');?>"></script>
